<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="manage/layout :: common_header(~{::title})">
    <title>资讯管理-网站后台管理中心</title>
</head>
<body th:replace="manage/layout :: common_body(~{::div.layui-body})">
<div class="layui-body" style="padding:15px;">

    <div class="sp-wrapper">
        <blockquote class="layui-elem-quote layui-text">
            资讯模块功能包括：新闻、关于我们、公司介绍、单页面
        </blockquote>

        <fieldset class="layui-elem-field">
            <legend>按条件搜索</legend>
            <div class="layui-field-box">
                <form class="layui-form layui-form-pane1" method="get" th:action="@{/manage/article_list}">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <input type="text" name="title" placeholder="标题" class="layui-input">
                        </div>
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <select name="type" id="type">
                                    <option value="">资讯类型</option>
                                    <option value="1">新闻</option>
                                    <option value="1">介绍文章</option>
                                    <option value="1">单页面</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button type="submit" class="layui-btn layui-btn-normal">搜索</button>
                            <i>总共：<span style="color: red" th:text="${totalSize}"></span>条记录</i>
                        </div>

                        <div class="layui-inline">
                            <a class="layui-btn layui-btn-primary" th:href="@{/manage/article_add}">添加资讯</a>
                        </div>
                    </div>

                </form>
            </div>
        </fieldset>


            <table class="layui-table dd-table" lay-even lay-skin="row">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>类型</th>
                    <th>图片</th>
                    <th>链接</th>
                    <th>排序值</th>
                    <th>上架时间</th>
                    <th>下架时间</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="BannersEntity,item:${bnList}">
                    <td class="center" th:text="${item.count}"></td>
                    <td class="center" th:text="${BannersEntity.getType()}"></td>
                    <td><img th:src="${BannersEntity.getImage()}"></td>
                    <td class="center" th:text="${BannersEntity.getUrl()}"></td>
                    <td class="center" th:text="${BannersEntity.getOrderNum()}"></td>
                    <td class="center" th:text="${BannersEntity.getUpOn()}"></td>
                    <td class="center" th:text="${BannersEntity.getLowerOn()}"></td>
                    <td class="center" th:text="${BannersEntity.getState()}"></td>
                    <td class="center">
                        <a class="layui-btn layui-btn-primary layui-btn-small"
                           th:href="@{/banner/bannerEdit(id=${BannersEntity.getId()})}">修改</a>
                        <a class="layui-btn layui-btn-primary layui-btn-small delete_data"
                           th:href="@{/banner/bannerDel(id=${BannersEntity.getId()})}"><i class="layui-icon"></i>删除</a>
                    </td>
                </tr>
                </tbody>
            </table>

        <div class="layui-box layui-laypage layui-laypage-default">

        </div>
        <div class="layui-box layui-laypage layui-laypage-default pageBox">
            <paging:pager th:value="${pageIndex}" th:rows="${totalSize}" th:size="${pageSize}"/>
        </div>
        <script type="text/javascript">
            //JavaScript代码区域
            layui.use(['jquery','form','layer'], function () {
               var $$ = layui.jquery;
                var form = layui.form;
                var layer = layui.layer;
                $$(function(){
                    var type = '[[${type}]]';
                    if(type !='' ) {
                        $$("#type").val(type);
                        form.render();
                    }
                })
            });
        </script>


    </div>
</div>
</body>
<html>
